/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * EmViewPanel.java
 *
 * Created on 27/11/2011, 01:29:38
 */
package proj5labbd.graphics.emissora;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import proj5labbd.DBInterface;
import proj5labbd.graphics.abstractOpGraphics.OperationPanel;

/**
 *
 * @author yole
 */
public class EmViewPanel extends OperationPanel {

    /** Creates new form EmViewPanel */
    
    public EmViewPanel(EmissoraFrame frame, DBInterface dbInterface) {
        super(frame,dbInterface);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jtbView = new javax.swing.JTable();
        jbtView = new javax.swing.JButton();
        jpnParam = new javax.swing.JPanel();
        jlbCNPJEm = new javax.swing.JLabel();
        jftxtCNPJ = new javax.swing.JFormattedTextField();
        jlbNomeC = new javax.swing.JLabel();
        jtxtNomeC = new javax.swing.JTextField();
        jlbDate = new javax.swing.JLabel();
        jtxtDate = new javax.swing.JTextField();
        jlbNomeF = new javax.swing.JLabel();
        jtxtNomeF = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jchkCNPJ = new javax.swing.JCheckBox();
        jchkNomeC = new javax.swing.JCheckBox();
        jchkNomeF = new javax.swing.JCheckBox();
        jchkDate = new javax.swing.JCheckBox();

        setBorder(javax.swing.BorderFactory.createTitledBorder("View"));

        jtbView.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(jtbView);

        jbtView.setText("View");

        jpnParam.setBorder(javax.swing.BorderFactory.createTitledBorder("Parâmetros da busca"));

        jlbCNPJEm.setText("CNPJ");

        try {
            jftxtCNPJ.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.###.###/####-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jftxtCNPJ.setFocusLostBehavior(javax.swing.JFormattedTextField.COMMIT);

        jlbNomeC.setText("Nome Completo");

        jtxtNomeC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtNomeCActionPerformed(evt);
            }
        });

        jlbDate.setText("Data de Fundação");

        jlbNomeF.setText("Nome Fantasia");

        jtxtNomeF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtNomeFActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jpnParamLayout = new javax.swing.GroupLayout(jpnParam);
        jpnParam.setLayout(jpnParamLayout);
        jpnParamLayout.setHorizontalGroup(
            jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnParamLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jpnParamLayout.createSequentialGroup()
                            .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jtxtNomeC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                                .addComponent(jftxtCNPJ, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
                            .addGap(18, 18, 18))
                        .addGroup(jpnParamLayout.createSequentialGroup()
                            .addComponent(jlbNomeC)
                            .addGap(102, 102, 102)))
                    .addGroup(jpnParamLayout.createSequentialGroup()
                        .addComponent(jlbCNPJEm, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(135, 135, 135)))
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlbDate)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jlbNomeF)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jtxtNomeF, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(jtxtDate, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jpnParamLayout.setVerticalGroup(
            jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpnParamLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbCNPJEm)
                    .addComponent(jlbDate))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jftxtCNPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbNomeC)
                    .addComponent(jlbNomeF))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpnParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtxtNomeC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtNomeF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Campos a selecionar"));

        jchkCNPJ.setText("CNPJ");
        jchkCNPJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jchkCNPJActionPerformed(evt);
            }
        });

        jchkNomeC.setText("Nome Completo");

        jchkNomeF.setText("Nome Fantasia");

        jchkDate.setText("Data de Fundação");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jchkCNPJ)
            .addComponent(jchkNomeC)
            .addComponent(jchkNomeF)
            .addComponent(jchkDate)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jchkCNPJ)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jchkNomeC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jchkNomeF)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jchkDate)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 617, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jpnParam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(12, 12, 12)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addComponent(jbtView, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jpnParam, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtView))
        );
    }// </editor-fold>//GEN-END:initComponents

private void jtxtNomeCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtNomeCActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jtxtNomeCActionPerformed

private void jtxtNomeFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtNomeFActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jtxtNomeFActionPerformed

private void jchkCNPJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchkCNPJActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jchkCNPJActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbtView;
    private javax.swing.JCheckBox jchkCNPJ;
    private javax.swing.JCheckBox jchkDate;
    private javax.swing.JCheckBox jchkNomeC;
    private javax.swing.JCheckBox jchkNomeF;
    javax.swing.JFormattedTextField jftxtCNPJ;
    private javax.swing.JLabel jlbCNPJEm;
    private javax.swing.JLabel jlbDate;
    private javax.swing.JLabel jlbNomeC;
    private javax.swing.JLabel jlbNomeF;
    private javax.swing.JPanel jpnParam;
    private javax.swing.JTable jtbView;
    javax.swing.JTextField jtxtDate;
    javax.swing.JTextField jtxtNomeC;
    javax.swing.JTextField jtxtNomeF;
    // End of variables declaration//GEN-END:variables


}
